<extend name="Base/no_side_common" />

<block name="body">
<style>
/*充值支付*/
.pay_dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    color: #fff;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    -webkit-box-orient: horizontal;
    -webkit-box-pack: center;
    -webkit-box-align: center;
    background: RGBA(0,0,0,.5);
}
.pay_dialog form {
    width: 80%;
    background: #fff;
    min-height: 200px;
    padding: 10px;
}
.pay_dialog .controls{text-align:center;}
</style>
  <div class="wrap">
	<section id="contents">
     
  
  <div class="tab-content" style="margin-top:30px;">
		<div class="form_body" id='scan_login' style="text-align: center;">
			<h2><eq name="is_test" value="1">小程序尚未发布，请用管理员微信或体验者微信<else/>请用微信</eq>扫码体验</h2>
			<div class="input_panel">
				<div id="qrCode">
					<img src="{$qr_code}" />
				</div>
				<p class="qr_time_tips"><eq name="is_test" value="1"><a href="javascript:;" id="add_tester">添加体验者</a></eq></p>
			</div>
		</div>
		<div class="form-item cf mt_10 bind_step_form_next_item">
         	<a class="btn" href="{:U('lists')}">返  回</a>
         
        </div>
	</div>
    
</section>
</div>
<div class="pay_dialog" style="display:none">
    	<form action="" style="border-radius: 3px;">
    		<div class="form-item cf" style="color: #000;text-align: center;padding: 10px;font-size: 20px;">
    			<h2>绑定体验者</h2>
    		</div>
           <div class="form-item cf">
                <div class="controls">
                 <input type="text" placeholder="体验者微信号" class="text input-large" name="wechat" value="">
                </div>
           </div>
           <div class="controls">
           		<a onClick="submitAdd()" href="javascript:;" class="flex_1 btn mr_10">绑定</a>
           		<a onClick="$('.pay_dialog').hide();" href="javascript:;" class="flex_1 btn gray_btn">取消</a>
           </div>
        </form>
    </div>
</block>
<block name="script">
  <script type="text/javascript">
			$('#submit').click(function() {
				$('#form').submit();
			});

			$(function() {
				$('#add_tester').click(function(){
					$('.pay_dialog').show();
				});
			});
			function submitAdd(){
				var wechat=$("input[name='wechat']").val();
				if(wechat==''){
					alert('请输入体验者微信号');
					return false;
				}
				var id="{$id}";
				$.post("{:U('bind_tester')}",{'wechat':wechat,'id':id},function(res){
					alert(res.info);
					if(res.status==1){
						$('.pay_dialog').hide();
					}
				});
			}
		</script> 
</block>
